﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLKhachSan.DTO;
using System.Data;
using System.Data.SqlClient;

namespace QLKhachSan.DAO
{
    public class DAO_PhieuThu
    {
        public static void themPhieuThu(DTO_PhieuThu p)
        {
            string[] name = new string[4] { "@MaKH","@MaNV","@TienPhaiTra","@NgayThu" };
            object[] ob = new object[4] {p.MaKH,p.MaNV,p.TienPhaiTra,p.NgayThu };
            clsKetNoi.ThucThiLenhCoTS("pr_ThemPhieuThu", name, ob, 4);
        }
        public static DataTable hienthiDanhSachPhieuThu()
        {
            return clsKetNoi.Load("pr_HienThiPhieuThu");
        }
        public static DataTable hienthiDanhSachPhieuThuDeBaoCao()
        {
            return clsKetNoi.Load("pr_HienThiPhieuThuDeBaoCao");
        }

        public static DataTable hienthiDanhSachPhieuThuInTheoMaPhieuThu(DTO_PhieuThu p)
        {
            string[] name = new string[1] { "@MaPhieuThu" };
            object[] ob = new object[1] { p.MaPhieuThu};
            return clsKetNoi.LoadCoTS("pr_HienThiPhieuThuDeInTheoMaPhieuThu",name,ob,1);
        }
        public static DataTable hienthiHoaDonInTheoMaPhieuThu(DTO_PhieuThu p)
        {
            string[] name = new string[1] { "@MaPhieuThu" };
            object[] ob = new object[1] { p.MaPhieuThu };
            return clsKetNoi.LoadCoTS("pr_HienThiHoaDonDeInTheoMaPhieuThu", name, ob, 1);
        }
        public static DataTable hienThiDanhSachPhieuThuKhoangThang(int ThangTu, int ThangDen, int NamTu, int NamDen)
        {
            string[] name = new string[4] { "@ThangTu", "@ThangDen", "@NamTu","@NamDen" };
            object[] ob = new object[4] { ThangTu, ThangDen, NamTu,NamDen };
            return clsKetNoi.LoadCoTS("pr_HienThiPhieuThuKhoangThang", name, ob, 4);
        }
    }
}
